<script type="text/javascript">
$().ready(function(){
	$("#name").autocomplete("/ajax/get-ingredients", {
		parse: function(data) {
			return $.map(eval(data), function(row) {
				return {
					data: row,
					value: row.id,
					result: row.name
				}
			});
		},
		formatItem: function(item) {
			return item.name;
		}
	});
	$("#measurement").autocomplete("/ajax/get-measurements", {
		parse: function(data) {
			return $.map(eval(data), function(row) {
				return {
					data: row,
					value: row.id,
					result: row.name
				}
			});
		},
		formatItem: function(item) {
			return item.name;
		}
	});
});
</script>

<?php echo $this->form; ?>
